package com.yxj04;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class CopyJavaDemo02 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("D:\\Ccode\\jdata-structure\\ByteStream9\\src\\com\\yxj04\\ConversionStreamDemo.java");
        FileWriter fw = new FileWriter("D:\\Ccode\\jdata-structure\\ByteStream9\\xopy.java");
        //读写文件
//        int ch;
//        while((ch = fr.read()) != -1) {
//            fw.write(ch);
//        }

        char[] chs = new char[1024];
        int len;
        while((len=fr.read(chs)) != -1) {
            fw.write(chs,0,len);
        }

        fw.close();
        fr.close();
    }
}
